package router

import (
	"exchangeapp/controllers"
	"exchangeapp/middlewares"
	"github.com/gin-gonic/gin"
)

func SetupRouter() *gin.Engine {
	router := gin.Default()

	auth := router.Group("/api/auth")
	{
		auth.POST("/login", controllers.Login)
		auth.POST("/register", controllers.Register)
	}
	student := router.Group("/api/student")
	{
		student.Use(middlewares.AuthMiddleware())
		{
			student.GET("/all", controllers.SearchAllStudent)
			student.POST("/add", controllers.AddStudent)
		}
	}
	likes := router.Group("/api/likes")
	{
		likes.GET("", controllers.LikeController)
	}
	return router
}
